import cityData from './cityData.json';
const getNameByCode = (code,data)=>{
  for (let item of data) {
    if (item.code === code) {
      return item.name;
    }
    if (item.children) {
      const name = getNameByCode(code, item.children);
      if (name) {
        return name;
      }
    }
  }
  return null;
}
export const getDistirectName = (code)=>{
  return getNameByCode(code,cityData)
}


